{% extends "base.html" %}
{% block title %} show all the people {% endblock %}

{% block _title %} <h1> All the People </h1> {% endblock %}
{% block jsCode %}
	{% load static %}
	<script type="text/javascript">
	function go_find_people(){
		var t_name=document.getElementById("id_p_name").value; 
		var loc = "/people/?name="
		loc=loc.concat(t_name);
		//for test: alert(loc);
		window.location=loc;
	};
	$(document).ready( function() {
		$("#id_p_name").autocomplete('/ajax/people/autocomplete/',{multiple:true,multipleSeparator:' '});
	});

	</script>
{% endblock %}

{% block content %}
	<div id="search_people_by_name" align="center">
		<font color="gray"> 想找谁？	
		<input id="id_p_name" type="text"/>
		</font>
	<input type="submit" value="找一下!" onclick="go_find_people();" /> 
	</div>
		
		{% if count %}
			<font color="red">{{ count }}</font><font color="gray"> people found.</font><br/>
			<ul>	
				{% for p in people.object_list %}
					<li> <a href="{{ p.get_ab_url }}" > {{ p.name }} </a>(<font color="gray">{{ p.departTree }}</font>) </i>
				{% endfor%}
			</ul>	
			<hr/>
			<div class="paginator"	>
				{% if people.has_previous %}
					<a href="?page={{ people.previous_page_number }}">&laquo;Pervious</a>
				{% endif %}
				<span class="current">
					Page {{ people.number }} of {{ people.paginator.num_pages }}.
				</span>
				{% if people.has_next %}
					<a href="?page={{ people.next_page_number }}">Next &raquo;</a>
				{% endif %}
			</div>
		
		{% else %}
			:(  no one found!
		{% endif %}

{%	endblock %}


